/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.expert.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.chlitina.store.common.persistence.BaseEntity;
import com.chlitina.store.modules.base.entity.Customer;
import com.chlitina.store.modules.base.entity.StoreCare;
import com.chlitina.store.modules.base.entity.StoreProduct;
import com.chlitina.store.modules.employee.entity.Employee;
import com.chlitina.store.modules.sms.entity.SmsSendQueue;
import com.chlitina.store.modules.sys.entity.Store;

/**
 * 客户产品护理提醒Entity
 * @author liujiang
 * @version 2014-02-19
 */
@Entity
@Table(name = "store_customer_notify")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class StoreCustomerNotify extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private Long id; 		// 编号
	private Store store; 	// 店面
	private Customer customer; 			// 客户姓名
	private Employee employee;				//诊断员工
	private CustomerSolution customerSolution; 	// 方案
	private StoreProduct storeProduct;//产品
	private StoreCare storeCare; //护理项目
	private Date notifyDate; //下次提醒日期
	private String content;
	private SmsSendQueue smsSendQueue;
	
	public StoreCustomerNotify() {
	}

	public StoreCustomerNotify(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	@ManyToOne(cascade={CascadeType.REFRESH}, fetch = FetchType.LAZY) 
	@JoinColumn(name="STORE_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public Store getStore() {
		return store;
	}

	public void setStore(Store store) {
		this.store = store;
	}
	
    @ManyToOne(cascade={CascadeType.REFRESH}, fetch = FetchType.LAZY) 
	@JoinColumn(name="CUSTOMER_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public Customer getCustomer() {
		return customer;
	}
    
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	
    @ManyToOne(cascade={CascadeType.REFRESH}, fetch = FetchType.LAZY) 
	@JoinColumn(name="EMPLOYEE_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}
	
	
	@ManyToOne(cascade={CascadeType.REFRESH}, fetch = FetchType.LAZY)
	@JoinColumn(name="SOLUTION_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public CustomerSolution getCustomerSolution() {
		return customerSolution;
	}

	public void setCustomerSolution(CustomerSolution customerSolution) {
		this.customerSolution = customerSolution;
	}

	@ManyToOne(cascade={CascadeType.REFRESH},fetch = FetchType.LAZY)
	@JoinColumn(name="PRODUCT_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public StoreProduct getStoreProduct() {
		return storeProduct;
	}

	public void setStoreProduct(StoreProduct storeProduct) {
		this.storeProduct = storeProduct;
	}
	
	@ManyToOne(cascade={CascadeType.REFRESH},fetch = FetchType.LAZY)
	@JoinColumn(name="CARE_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public StoreCare getStoreCare() {
		return storeCare;
	}

	public void setStoreCare(StoreCare storeCare) {
		this.storeCare = storeCare;
	}
	
	public Date getNotifyDate() {
		return notifyDate;
	}

	public void setNotifyDate(Date notifyDate) {
		this.notifyDate = notifyDate;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@ManyToOne(cascade={CascadeType.REFRESH}, fetch = FetchType.LAZY)
	@JoinColumn(name="SSQ_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public SmsSendQueue getSmsSendQueue() {
		return smsSendQueue;
	}

	public void setSmsSendQueue(SmsSendQueue smsSendQueue) {
		this.smsSendQueue = smsSendQueue;
	}

}


